<template>
  <uni-card v-for="message in boss_messages" v-bind="message" :title="message.title" extra="详情"
    @touchend="handleSwitch(message._id)">
    {{ message.content }}
  </uni-card>
</template>

<script setup>
import { computed } from 'vue';
import { useMessagesStore } from '../../stores/messages';

const allMessages = useMessagesStore()
allMessages.getOrders()
const boss_messages = computed(() => {
  return allMessages.messages.filter(m => m.type === 2)
})

function handleSwitch(id) {
  uni.navigateTo({ url: "/pages/detailed_information/detailed_information?id=" + id });
}
</script>